| Fully Qualified Name: | CodeIgniter\HTTP\Negotiate |
Class Negotiate
Provides methods to negotiate with the HTTP headers to determine the best type match between what the application supports and what the requesting getServer wants.
| Name | Description | Defined By |
|---|---|---|
| __construct() | Constructor | Negotiate |
| charset() | Determines the best charset to use based on the $supported types the application says it supports, and the types requested by the client. | Negotiate |
| encoding() | Determines the best encoding type to use based on the $supported types the application says it supports, and the types requested by the client. | Negotiate |
| language() | Determines the best language to use based on the $supported types the application says it supports, and the types requested by the client. | Negotiate |
| matchLocales() | Will match locales against their broader pairs, so that fr-FR would match a supported localed of fr | Negotiate |
| matchTypes() | Compares the types/subtypes of an acceptable Media type and the supported string. | Negotiate |
| media() | Determines the best content-type to use based on the $supported types the application says it supports, and the types requested by the client. | Negotiate |
| parseHeader() | Parses an Accept* header into it's multiple values. | Negotiate |
| setRequest() | Stores the request instance to grab the headers from. | Negotiate |
Constructor
| Parameter Name | Type | Description |
|---|---|---|
| $request | \CodeIgniter\HTTP\RequestInterface |
Returns:
Determines the best charset to use based on the $supported types the application says it supports, and the types requested by the client.
If no match is found, the first, highest-ranking client requested type is returned.
| Parameter Name | Type | Description |
|---|---|---|
| $supported | array |
Returns: string
Determines the best encoding type to use based on the $supported types the application says it supports, and the types requested by the client.
If no match is found, the first, highest-ranking client requested type is returned.
| Parameter Name | Type | Description |
|---|---|---|
| $supported | array |
Returns: string
Determines the best language to use based on the $supported types the application says it supports, and the types requested by the client.
If no match is found, the first, highest-ranking client requested type is returned.
| Parameter Name | Type | Description |
|---|---|---|
| $supported | array |
Returns: string
Will match locales against their broader pairs, so that fr-FR would match a supported localed of fr
| Parameter Name | Type | Description |
|---|---|---|
| $acceptable | array | |
| $supported | array |
Returns: bool
Compares the types/subtypes of an acceptable Media type and the supported string.
| Parameter Name | Type | Description |
|---|---|---|
| $acceptable | array | |
| $supported | array |
Returns: bool
Determines the best content-type to use based on the $supported types the application says it supports, and the types requested by the client.
If no match is found, the first, highest-ranking client requested type is returned.
| Parameter Name | Type | Description |
|---|---|---|
| $supported | array | |
| $strictMatch | bool | If |
Returns: string
Parses an Accept* header into it's multiple values.
This is based on code from Aura.Accept library.
| Parameter Name | Type | Description |
|---|---|---|
| $header | string |
Returns: array
Stores the request instance to grab the headers from.
| Parameter Name | Type | Description |
|---|---|---|
| $request | \RequestInterface |
Returns: $this